/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ecom.entity;

/**
 *
 * @author simon
 */
public enum TransportEnum {

    POSTE(1,6), COLISSIMO24(2,8), TNT24(3,12);
    protected int id;
    protected int price;

    /** Constructeur */
    TransportEnum(int id, int price) {
        this.id = id;
        this.price = price;
    }
    
    public int getId() {
        return this.id;
    }

    public int getPrice() {
        return this.price;
    }

    public static TransportEnum transformStringTransportToEnum(String transportString) {
        TransportEnum transport;

        if (transportString.equals("POSTE")) {
            transport = TransportEnum.POSTE;
        } else {
            transport = TransportEnum.COLISSIMO24;
        }

        return transport;
    }
}
